import time
from selenium import webdriver
driver = webdriver.Chrome()
driver.get('https://dx.yayi360.com/#/')
driver.maximize_window()
driver.find_element_by_xpath('//input[@placeholder="请输入手机号"]').send_keys('18340870900')
driver.find_element_by_xpath('//input[@placeholder="请输入密码"]').send_keys('123456')
driver.find_element_by_xpath('//div[text()="登录"]').click()
# driver.find_element_by_xpath('//img').click()
time.sleep(3)
driver.find_element_by_xpath('//*[@id="app"]/div[1]/div/div[2]/span/img').click()
time.sleep(1)
driver.find_element_by_xpath('//a[text()="个人中心"]').click()
time.sleep(1)
driver.find_element_by_xpath('//span[text()="修改"]').click()
time.sleep(2)
driver.find_element_by_xpath('//div[@class="yg-form-item__content"]/div/input').click()
driver.find_element_by_xpath('//div[@class="yg-form-item__content"]/div/input').send_keys('liuyu')
time.sleep(2)
driver.find_element_by_xpath('//*[@id="app"]/div[2]/div[2]/div/div/div[4]/div/div[3]/input[1]').click()
driver.find_element_by_xpath('//*[@id="app"]/div[1]/div/div[2]/span/img').click()
driver.find_element_by_xpath('//a[text()="退出登录"]').click()
driver.find_element_by_xpath('//*[@id="yg_msgbox_dom"]/div/div[3]/input[1]').click()
time.sleep(3)
url = driver.current_url
print(url)
if url == "https://dx.yayi360.com/#/":
    time.sleep(1)
    print('作业完成')
driver.quit()